﻿/*******************************************************************************
 * AAEngine
 * Copyright (c) 2010 Mike Jarosch
 *
 * Original source PushButton Engine:
 * Copyright (C) 2009 PushButton Labs, LLC
 * For more information see http://www.pushbuttonengine.com
 *
 * This file is licensed under the terms of the MIT license, which is included
 * in the "MIT License.txt" file at the root directory of this SDK.
 ******************************************************************************/

using Microsoft.Xna.Framework;

namespace AAEngine.Rendering2D.SpriteSheet
{
    /// <summary>
    /// Base interface for descriptions about how frames are laid out in a sprite sheet.
    /// </summary>
    public interface ISpriteSheetDivider
    {
        /// <summary>
        /// How many frames are in this sprite sheet?
        /// </summary>
        int FrameCount { get; }

        /// <summary>
        /// Many times you want to infer information about frames based on data
        /// from the sprite sheet. When the divider is assigned to a sprite sheet,
        /// the sprite sheet passes itself to OwningSheet so you can store it and
        /// get information from it.
        /// </summary>
        SpriteSheetComponent OwningSheet { set; }

        /// <summary>
        /// Return the size of a frame, given the desired index and the source
        /// image's dimensions.
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        Rectangle FrameArea(int index);

        /// <summary>
        /// The MultiSpriteSheetHelper has to be able to clone dividers. So we
        /// have a Clone method.
        /// </summary>
        /// <returns></returns>
        ISpriteSheetDivider Clone();
    }
}
